from typing import *
from math import inf
class Solution:
    def minimumSubarrayLength(self, nums: List[int], k: int) -> int:
        l = len(nums)
        ans = inf
        for i in range(l):
            s = 0
            for j in range(i,l):
                s |= nums[j]
                if s>= k:
                    ans = min(ans,j - i + 1)
        return -1 if ans == inf else ans